		<div class="ui-portlet">
			{{template wxes/_user_wxes}}
			<ol class="breadcrumb">
			  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;个人中心</a></li>
			  <li class="active">微信自动回复</li>
			  <li class="active">近义词设置</li>
			</ol>
		</div>  
<hr>
<div id="SimilarForm">
{{$this->Form->create('WxSimilar',array('class'=>'form-horizontal','role'=>'form'))}}

<?php
	if(!empty($this->data['WxSimilar']['msg_type'])) {
		$_REQUEST['type'] = $this->data['WxSimilar']['msg_type'];  
	}

?>

	<div class="form-group form-inline">
		<label class="col-sm-2 control-label" for="WxSimilarKeyword">关键字 <span style="color:red;">*</span></label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('name',array('class'=>'form-control','placeholder'=>'直接输入关键字或者选择系统事件','required'=>'required','div'=>false,'label'=>false))}}
			{{$this->Form->hidden('referer',array('value'=>'/wx_auto_replies/mine'))}}
		</div>
	</div>	
	{{$this->Form->hidden('id')}}
	
	<div class="form-group">
			<label class="col-sm-2 control-label" for="WxSimilarWords">状态</label>
			<div class="col-sm-9 controls">
				{{$this->Form->input('status',array('class'=>'form-control','options'=> array('0'=>'未启用','1'=>'启用'),'default'=>1,'div'=>false,'label'=>false))}}
			</div>
	</div>

	<div class="form-group">
			<label class="col-sm-2 control-label" for="WxSimilarWords">近义词</label>
			<div class="col-sm-9 controls">
				{{$this->Form->input('words',array('class'=>'form-control','rows'=>6,'div'=>false,'label'=>false))}}
				<p><small>近义词每行一个。用户发送近义词时，收到相同的自动回复内容。</small></p>
			</div>
		</div>


		
	
	<div class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9"><input class="btn btn-primary" type="submit" value="提交"></div>
	</div>
	{{$this->Form->end()}}
	</div>

<script>

$(function(){
	$('#system-event').change(function(){
		if($(this).val() != ""){
			$('#WxSimilarKeyword').val($(this).val());
			$('#WxSimilarName').val( $("option:selected",this).text() );
		}
		else{
			$('#WxSimilarName').val( "" );
			$('#WxSimilarKeyword').val("");
		}
		
	})
});

</script>